A Tour of C++ by Bjarne Stroustrup
Author:Bjarne Stroustrup
Language: eng
Format: epub, pdf
Publisher: Pearson Education
Published: 2018-03-13T16:00:00+00:00
9.5 Advice
[1] Use std::string to own character sequences; §9.2; [CG: SL.str.1].
[2] Prefer string operations to C-style string functions; §9.1.
[3] Use string to declare variables and members rather than as a base class; §9.2.
[4] Return strings by value (rely on move semantics); §9.2, §9.2.1.
[5] Directly or indirectly, use substr() to read substrings and replace() to write substrings; §9.2.
[6] A string can grow and shrink, as needed; §9.2.
[7] Use at() rather than iterators or [ ] when you want range checking; §9.2.
[8] Use iterators and [ ] rather than at() when you want to optimize speed; §9.2.
[9] string input doesn’t overflow; §9.2, §10.3.
[10] Use c_str() to produce a C-style string representation of a string (only) when you have to; §9.2.
[11] Use a stringstream or a generic value extraction function (such as to<X>) for numeric conversion of strings; §10.8.
[12] A basic_string can be used to make strings of characters on any type; §9.2.1.
[13] Use the s suffix for string literals meant to be standard-library strings; §9.3 [CG: SL.str.12].
[14] Use string_view as an argument of functions that needs to read character sequences stored in various ways; §9.3 [CG: SL.str.2].
[15] Use gsl::string_span as an argument of functions that needs to write character sequences stored in various ways; §9.3. [CG: SL.str.2] [CG: SL.str.11].
[16] Think of a string_view as a kind of pointer with a size attached; it does not own its characters; §9.3.
[17] Use the sv suffix for string literals meant to be standard-library string_views; §9.3.
[18] Use regex for most conventional uses of regular expressions; §9.4.
[19] Prefer raw string literals for expressing all but the simplest patterns; §9.4.
[20] Use regex_match() to match a complete input; §9.4, §9.4.2.
[21] Use regex_search() to search for a pattern in an input stream; §9.4.1.
[22] The regular expression notation can be adjusted to match various standards; §9.4.2.
[23] The default regular expression notation is that of ECMAScript; §9.4.2.
[24] Be restrained; regular expressions can easily become a write-only language; §9.4.2.
[25] Note that \i allows you to express a subpattern in terms of a previous subpattern; §9.4.2.
[26] Use ? to make patterns “lazy”; §9.4.2.
[27] Use regex_iterators for iterating over a stream looking for a pattern; §9.4.3.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Ada | Ajax |
Assembly Language Programming | Borland Delphi |
C & C++ | C# |
CSS | Compiler Design |
Compilers | DHTML |
Debugging | Delphi |
Fortran | Java |
Lisp | Perl |
Prolog | Python |
RPG | Ruby |
Swift | Visual Basic |
XHTML | XML |
XSL |
Hello! Python by Anthony Briggs(9926)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9800)
The Mikado Method by Ola Ellnestam Daniel Brolund(9786)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8309)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7787)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7771)
Grails in Action by Glen Smith Peter Ledbrook(7705)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7566)
Windows APT Warfare by Sheng-Hao Ma(6920)
Layered Design for Ruby on Rails Applications by Vladimir Dementyev(6653)
Blueprints Visual Scripting for Unreal Engine 5 - Third Edition by Marcos Romero & Brenden Sewell(6515)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6423)
Kotlin in Action by Dmitry Jemerov(5073)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(4323)
Solidity Programming Essentials by Ritesh Modi(4048)
Functional Programming in JavaScript by Mantyla Dan(4044)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3839)
Unity 3D Game Development by Anthony Davis & Travis Baptiste & Russell Craig & Ryan Stunkel(3782)
The Ultimate iOS Interview Playbook by Avi Tsadok(3757)
